DEF_PROJECT=../..
include $(DEF_PROJECT)/scripts/main.mk
name=linux
version=2.6.39.4
extdeps=eglibc-tools gcc-tools binutils-tools linux-header-tools
patch=linux-2.6.39.4.patch
DL_SERV=http
DL_HOST=www.kernel.org
DL_PATH=pub/linux/kernel/v2.6
DL_SUFFIX=tar.bz2

mflags+=ARCH=$(patsubst i%86,x86,$(CC_ARCH)) CROSS_COMPILE=$(addsuffix -,$(CC_TARGET))

iflags+=ARCH=$(patsubst i%86,x86,$(CC_ARCH)) CROSS_COMPILE=$(addsuffix -,$(CC_TARGET)) 
iflags+=INSTALL_MOD_PATH=$(DIR_SYSROOT)
iflags+=INSTALL_PATH=$(DIR_SYSROOT)/boot
iflags+=modules_install

pre-build:
	mkdir -p $(DIR_SYSROOT)/boot
	cd $(source); $(MAKE) mrproper
	sed -e '/INSTALLKERNEL/d' -i $(source)/arch/$(patsubst i%86,x86,$(CC_ARCH))/boot/install.sh
	#cd $(source); $(MAKE) defconfig ARCH=$(patsubst i%86,x86,$(CC_ARCH)) CROSS_COMPILE=$(addsuffix -,$(CC_TARGET))
	cp -af $(DIR_ORIG)/config-2.6.39.4-$(CC_ARCH) $(source)/.config

